package Chapter05.cak.game;

public class TestGame {
    public static void main(String[] args) {
        GameManager gameManager = new GameManager();

        // 添加游戏
        Game game1 = new Game("英雄联盟", 10000000);
        Game game2 = new Game("穿越火线", 5000000);
        Game game3 = new Game("我的世界", 20000000);
        gameManager.addGame(game1);
        gameManager.addGame(game2);
        gameManager.addGame(game3);

        // 统计游戏人数
        int totalNumOfPlayers = gameManager.getTotalNumOfPlayers();
        System.out.println("Total number of players: " + totalNumOfPlayers);

        // 统计某个游戏的人数
        int numOfPlayersByGame = gameManager.getNumOfPlayersByGame("英雄联盟");
        System.out.println("Number of players in 英雄联盟: " + numOfPlayersByGame);

        // 删除游戏
        gameManager.removeGame(game1);

        // 统计游戏人数
        totalNumOfPlayers = gameManager.getTotalNumOfPlayers();
        System.out.println("Total number of players: " + totalNumOfPlayers);
    }
}
